package com.dddpeter.app.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.dddpeter.app.entity.User;

/** 
* @ClassName: HomeController 
* @Description: 主页控制程序
* @author Peter Lee
* @date 2014年8月11日 下午2:04:02 
*  
*/
@Controller
public class HomeController {
	/** 
	* @Title: index 
	* @Description: 登录页面展示
	* @param session
	* @return    设定文件 
	* @return ModelAndView    返回类型 
	* @throws 
	*/
	@RequestMapping("/index.do")
	public ModelAndView index(HttpSession session) {
		Map<String, Object> model = new HashMap<String, Object>();
		model.put("emsg", ((User) session.getAttribute("user")).getUserName()
				+ "已经登录");
		model.put("username",
				((User) session.getAttribute("user")).getUserName());
		ModelAndView mav = new ModelAndView("home", model);
		return mav;
	}

}
